import {request} from 'umi'
import {Iaddexamquestions,QuestionsType,getQuestions,editQuestionInt} from '@/interface/question'
//获取考 试类型
export const getExamType = () => {
    return request('/exam/examType',{method:'get'});
}
//获取课程类型
export const getSubject = () => {
    return request('/exam/subject',{method:'get'});
}
//获取题目类型
export const getQuestionsType = () => {
    return request('/exam/getQuestionsType',{method:'get'});
}
//获取所有的试题
export const getquestions = () => {
    return request('/exam/questions/new',{method:'get'})
}
//获取试题分类列表
export const getQuestionsTypeList = () => {
    return request('/exam/getQuestionsType',{method:'get'});
}

//添加试题
export const addexamquestions=(data:Iaddexamquestions)=>{
     return request("/exam/questions",{method:"post",data})
}

//添加试题分类

export const addinsertQuestionsType=(params:QuestionsType)=>{
    console.log(params)
    return request('/exam/insertQuestionsType',{method:"get",params})
}

//按条件获取试题
export const getquestionscondition=(params:getQuestions)=>{
   
     return request("/exam/questions/condition",{method:"get",params})
}

//编辑试题
export const editQuestion=(data:editQuestionInt)=>{
    console.log(data)
    return request('/exam/questions/update',{method: 'PUT',data})
}
